#include <stdio.h>
#include <algorithm>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <string.h>
using namespace std;

#define TRACE(x...) 
#define PRINT(x...) TRACE(printf(x))

#define rep(i,n) for (int i=0; i<n; i++)
#define inter(i,a,b) for (int i=a; i<b; i++)

#define oo 0x3f3f3f3f

#define f first
#define s second
#define mp make_pair

int a, b, n;
int d[110];
int s;

int main() {
	scanf("%d", &n);
	rep(i,n-1) scanf("%d", &d[i]);
	scanf("%d %d", &a, &b);
	a--; b--;

	TRACE(
		printf("n: %d, a: %d, b: %d\n", n, a, b);
		rep(i,n-1) printf("%d ", d[i]);
		printf("\n");
	)

	s=0;
	inter(i,a,b) s+=d[i];
	printf("%d\n", s);

	return 0;
}
